package com.hera.process.config.service.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import com.hera.base.util.FiltroDTO;
import com.hera.process.config.dao.DataSourceDao;
import com.hera.process.config.domain.Datasource;
import com.hera.process.config.service.DataSourceService;
@Service("datasourceService")
public class DataSourceServiceImpl implements DataSourceService{


	static final Logger logger = Logger.getLogger(DataSourceServiceImpl.class);

	@Autowired
	private DataSourceDao datasourceDao;
	/**
	 * 
	 */
	public DataSourceServiceImpl() {
		
	}
	
	
	
	@Override
	public Datasource findById(Long id) {
		
		return datasourceDao.findOne(id);
	}
	@Override
	public void update(Datasource entity) {
		
		datasourceDao.save(entity);
		
	}
	@Override
	public void save(Datasource entity) {
		
		datasourceDao.save(entity);
		
	}
	@Override
	public void delete(Datasource entity) {
		
		datasourceDao.delete(entity);
		
	}
	@Override
	public List<Datasource> findAll() {
		
		return datasourceDao.findAll();
	}
	@Override
	public List<Datasource> findAll(FiltroDTO filtroDTO) {
		
		return datasourceDao.obtenerEntidadesPorFiltros(filtroDTO);
	}


}
